package org.pzy.java.base;

import cn.hutool.core.date.DateUtil;

import java.util.Date;

/**
 * @Author: DRevelation
 * @Date: 2022/11/7 9:32
 */
public class WhileTrue {

    public static int i = 5;

    public static void main(String[] args) throws InterruptedException {
        int pullNum = 0;
        boolean flag = true;
        while (flag) {
            int a = increment();
            if (a > 0) {
                Integer newPullNum = ++pullNum;
                System.out.println("newPullNum=" + newPullNum + ",pullNum=" + pullNum);
            } else {
                flag = false;
            }
            Thread.sleep(1000);
        }
        System.out.println("pullNum = " + pullNum);
        System.out.println(DateUtil.format(new Date(), "yyMMdd"));
        Vote vote = new Vote();
        vote.setId(1L);
        vote.setIsFlag(null);
        System.out.println(vote.getIsFlag());
    }

    private static int increment() {
        return i--;
    }
}
